package cn.edu.lcu.cs.javaprogramming.io;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class CopyCon {
    public static void main(String[] args) throws IOException {
        String filename = "D:/copycon.txt";
        Path path = Paths.get(filename);
        System.out.println("path.toAbsolutePath() = " + path.toAbsolutePath());
        System.out.println("path = " + path);
        // 复制控制台的内容到路径
        Files.copy(System.in, path, StandardCopyOption.REPLACE_EXISTING);
    }
}
